<?php

namespace App\Models;

use App\Models\BaseModel;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class DictItem extends BaseModel
{
    protected $table = 'dict_items';

    protected $fillable = [
        'label',
        'value',
        'status',
        'sort',
        'tagType',
        'dict_id',
    ];

    /**
     * 获取字典项所属的字典
     */
    public function dict(): BelongsTo
    {
        return $this->belongsTo(Dict::class, 'dict_id');
    }
}
